package com.self.baseutile.Utile;

import android.view.View;

import rx.Observable;
import rx.Subscriber;

/**
 * Craeted by: huangdx
 * Date : 2021/3/20
 * Describe :防止按钮重复点击
 */
public class ClickSubscribe implements Observable.OnSubscribe<View> {
    private Subscriber mSubscriber;
    public ClickSubscribe(View view) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSubscriber.onNext(v);
            }
        });
    }
    @Override
    public void call(Subscriber<? super View> subscriber) {
        mSubscriber = subscriber;
    }
}
